package com.citcc4.traffic.data.mapper;

import com.citcc4.traffic.data.domain.log.LogCommonErrorEntity;
import com.citcc4.traffic.data.domain.log.LogCommonErrorEntityExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface LogCommonErrorEntityMapper {
    @SelectProvider(type=LogCommonErrorEntitySqlProvider.class, method="countByExample")
    long countByExample(LogCommonErrorEntityExample example);

    @DeleteProvider(type=LogCommonErrorEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(LogCommonErrorEntityExample example);

    @Delete({
        "delete from vehiclenetworking.TB_LOG_COMMON_ERROR",
        "where ID = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into vehiclenetworking.TB_LOG_COMMON_ERROR (ID, STEP_NAME, ",
        "ERROR_INFO, IMPORTANT_ID, ",
        "STATIS_DATE, DEL_FLAG, CREATE_DATE, ",
        "UPDATE_DATE, CREATOR, ",
        "MODIFIER)",
        "values (#{id,jdbcType=VARCHAR}, #{stepName,jdbcType=VARCHAR}, ",
        "#{errorInfo,jdbcType=VARCHAR}, #{importantId,jdbcType=VARCHAR}, ",
        "#{statisDate,jdbcType=DATE}, #{delFlag,jdbcType=CHAR}, #{createDate,jdbcType=DATE}, ",
        "#{updateDate,jdbcType=DATE}, #{creator,jdbcType=VARCHAR}, ",
        "#{modifier,jdbcType=VARCHAR})"
    })
    int insert(LogCommonErrorEntity record);

    @InsertProvider(type=LogCommonErrorEntitySqlProvider.class, method="insertSelective")
    int insertSelective(LogCommonErrorEntity record);

    @SelectProvider(type=LogCommonErrorEntitySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="STEP_NAME", property="stepName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ERROR_INFO", property="errorInfo", jdbcType=JdbcType.VARCHAR),
        @Result(column="IMPORTANT_ID", property="importantId", jdbcType=JdbcType.VARCHAR),
        @Result(column="STATIS_DATE", property="statisDate", jdbcType=JdbcType.DATE),
        @Result(column="DEL_FLAG", property="delFlag", jdbcType=JdbcType.CHAR),
        @Result(column="CREATE_DATE", property="createDate", jdbcType=JdbcType.DATE),
        @Result(column="UPDATE_DATE", property="updateDate", jdbcType=JdbcType.DATE),
        @Result(column="CREATOR", property="creator", jdbcType=JdbcType.VARCHAR),
        @Result(column="MODIFIER", property="modifier", jdbcType=JdbcType.VARCHAR)
    })
    List<LogCommonErrorEntity> selectByExample(LogCommonErrorEntityExample example);

    @Select({
        "select",
        "ID, STEP_NAME, ERROR_INFO, IMPORTANT_ID, STATIS_DATE, DEL_FLAG, CREATE_DATE, ",
        "UPDATE_DATE, CREATOR, MODIFIER",
        "from vehiclenetworking.TB_LOG_COMMON_ERROR",
        "where ID = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="STEP_NAME", property="stepName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ERROR_INFO", property="errorInfo", jdbcType=JdbcType.VARCHAR),
        @Result(column="IMPORTANT_ID", property="importantId", jdbcType=JdbcType.VARCHAR),
        @Result(column="STATIS_DATE", property="statisDate", jdbcType=JdbcType.DATE),
        @Result(column="DEL_FLAG", property="delFlag", jdbcType=JdbcType.CHAR),
        @Result(column="CREATE_DATE", property="createDate", jdbcType=JdbcType.DATE),
        @Result(column="UPDATE_DATE", property="updateDate", jdbcType=JdbcType.DATE),
        @Result(column="CREATOR", property="creator", jdbcType=JdbcType.VARCHAR),
        @Result(column="MODIFIER", property="modifier", jdbcType=JdbcType.VARCHAR)
    })
    LogCommonErrorEntity selectByPrimaryKey(String id);

    @UpdateProvider(type=LogCommonErrorEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") LogCommonErrorEntity record, @Param("example") LogCommonErrorEntityExample example);

    @UpdateProvider(type=LogCommonErrorEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") LogCommonErrorEntity record, @Param("example") LogCommonErrorEntityExample example);

    @UpdateProvider(type=LogCommonErrorEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(LogCommonErrorEntity record);

    @Update({
        "update vehiclenetworking.TB_LOG_COMMON_ERROR",
        "set STEP_NAME = #{stepName,jdbcType=VARCHAR},",
          "ERROR_INFO = #{errorInfo,jdbcType=VARCHAR},",
          "IMPORTANT_ID = #{importantId,jdbcType=VARCHAR},",
          "STATIS_DATE = #{statisDate,jdbcType=DATE},",
          "DEL_FLAG = #{delFlag,jdbcType=CHAR},",
          "CREATE_DATE = #{createDate,jdbcType=DATE},",
          "UPDATE_DATE = #{updateDate,jdbcType=DATE},",
          "CREATOR = #{creator,jdbcType=VARCHAR},",
          "MODIFIER = #{modifier,jdbcType=VARCHAR}",
        "where ID = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(LogCommonErrorEntity record);
}